var t = u(require("../../@babel/runtime/regenerator")),
  e = require("../../@babel/runtime/helpers/asyncToGenerator"),
  a = require("@/utils/jump"),
  r = u(require("../../config/index")),
  i = u(require("../../config/page")),
  n = require("@/utils/report"),
  o = require("@/services/explain-line-service"),
  s = require("@/services/user-service");
function u(t) {
  return t && t.__esModule ? t : { default: t };
}
Page({
  data: {
    background: "transparent",
    iconTheme: "white",
    CDN: r.default.CDN,
    position: !0,
    isShow: !1,
    list: [],
    startTime: 0,
    scrollTop: 0,
  },
  onShareAppMessage: function () {
    return {
      title: r.default.share.title,
      imageUrl: r.default.share.pic,
      path: i.default.PAGE_TOUR_INDEX,
    };
  },
  onLoad: function () {
    this.setData({ startTime: Date.now() }),
      wx.setNavigationBarColor({
        backgroundColor: "#ffffff",
        frontColor: "#ffffff",
      });
  },
  onUnload: function () {
    var t = Date.now() - this.data.startTime;
    (0, n.report)("vpage_show", { time: t });
  },
  onHide: function () {
    this.setData({ isShow: !1 });
    var t = Date.now() - this.data.startTime;
    (0, n.report)("vpage_show", { time: t });
  },
  onShow: function () {
    var t = this;
    "function" == typeof this.getTabBar &&
      this.getTabBar() &&
      this.getTabBar().setData({ selected: 1 }, function () {
        t.getTabBar().play();
      }),
      this.setData({ isShow: !0, scrollTop: 0 }),
      this.init();
  },
  init: function () {
    var a = this;
    return e(
      t.default.mark(function e() {
        var r;
        return t.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (t.next = 2), (0, o.getExplainLineList)();
              case 2:
                (r = t.sent), a.setData({ list: r });
              case 4:
              case "end":
                return t.stop();
            }
        }, e);
      }),
    )();
  },
  scroll: function (t) {
    t.detail.scrollTop > 60
      ? this.setData({ background: "#0C1411" })
      : this.setData({ background: "transparent" });
  },
  toRoute: function (t) {
    var e = t.currentTarget.dataset.item;
    ((0, n.report)("vpage_tour_click", {}), e.active)
      ? (0, a.navigateTo)(i.default.PAGE_TOUR_INDOOR_PATH, { id: e.id })
      : (0, s.getLoginStatus)()
        ? (0, a.navigateTo)(
            "".concat(
              i.default.PAGE_ORDER_TRANSFER,
              "?url=plugin://order/audioGuide-page",
            ),
            {},
          )
        : (0, a.navigateTo)(i.default.PAGE_LOGIN, { type: 99 });
  },
  routeMap: function () {
    (0, a.navigateTo)(i.default.PAGE_TOUR_MAP_INDEX, {});
  },
});
